#include <iostream>
#include <string>
using namespace std;
int main()
{
    string str, c;
    bool book[10005] = {false};
    getline(cin, str);
    getline(cin, c);
    for (int i = 0; i < c.length(); i++)
    {
        book[c[i]] = true;
    }
    for (int i = 0; i < str.length(); i++)
    {
        if (!book[str[i]])
        {
            cout << str[i];
        }
    }
    cout << endl;
    return 0;
}